<?php
  $path = drupal_get_path('module', 'service');
  drupal_add_css($path . '/css/service.css');
  drupal_add_js($path . '/js/service.js');

function services_dept_data($depid) {
global $language,$base_url,$user;
//print_r($language);
 $url = $base_url . '/' . drupal_get_path('module', 'service');
 
 my_db_change(1); 
 $depid = arg(2);

$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'service_registration')   
  ->fieldCondition('field_src_dept', 'value', $depid, '=')
  ->propertyCondition('status',1);
 // ->propertyCondition('language', array($GLOBALS['language']->language, LANGUAGE_NONE), 'IN');
  
$result = $query->execute();


$nid = current($result['node']);

if (isset($result['node'])) {
  $news_items_nids = array_keys($result['node']); 
  
  $news_items = entity_load('node', $news_items_nids);
}
//print "<pre>";print_r($news_items);print "</pre>";
 my_db_change(0);
  $output = '<div class="rsslogo">' . get_rss_feed("service_rss_feed/$depid") . '</div>	';

 $output .= theme('service_dep_profile_theme',array('items' => $news_items,'depid'=>$depid,'nid'=>$nid));
return $output;					


}